package com.itheima.clientAndService01;

import java.util.HashMap;
import java.util.Map;

public class MainClass02 {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();
        map.put("heima001","张三");
        map.put("heima002","李四");
        map.put("heima003","王五");
        map.put("heima004","王五");
        //System.out.println(map);

        //method1(map);
        //method2(map);
        //method3(map);
        //method4(map);
        //method5(map);
        //method6(map);
    }

    private static void method6(Map<String, String> map) {
        map.remove("heima001");
        System.out.println(map);
    }

    private static void method5(Map<String, String> map) {
        int size = map.size();
        System.out.println(size);
    }

    private static void method4(Map<String, String> map) {
        boolean b1 = map.containsValue("张三");
        boolean b2 = map.containsValue("赵六");
        System.out.println(b1);
        System.out.println(b2);
    }

    private static void method3(Map<String, String> map) {
        boolean b1 = map.containsKey("heima001");
        boolean b2 = map.containsKey("aaa");
        System.out.println(b1);
        System.out.println(b2);
    }

    private static void method2(Map<String, String> map) {
        boolean empty1 = map.isEmpty();
        System.out.println(empty1);
        map.clear();
        boolean empty2 = map.isEmpty();
        System.out.println(empty2);
    }

    private static void method1(Map<String, String> map) {
        map.clear();
        System.out.println(map);
    }
}
